/*
 * Copyright (c) 2017. 杭州端点网络科技有限公司.  All rights reserved.
 */

package com.jiantong.user.enums;

/**
 * @author : panxin
 */
public enum DepartmentType {

    DECLARE_STATION(1, "管理申报点"),
    BUTCHER(2, "管理屠宰场"),
    NORMAL_DEPARTMENT(3, "政府一般部门"),
    SPECIAL_DEPARTMENT(4, "政府特殊部门");

    private final int value;

    private final String description;

    DepartmentType(int value, String description) {
        this.value = value;
        this.description = description;
    }

    public static DepartmentType from(int value) {
        for (DepartmentType ta : DepartmentType.values()) {
            if (ta.value == value) {
                return ta;
            }
        }
        throw new IllegalArgumentException("dept.type.undefined");
    }

    public int value() {
        return this.value;
    }


    @Override
    public String toString() {
        return description;
    }
}
